<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>rapidjson: rapidjson::GenericReader&lt; Encoding, Allocator &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">rapidjson
   </div>
   <div id="projectbrief">A fast JSON parser/generator for C++ with both SAX/DOM style API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>rapidjson</b></li><li class="navelem"><a class="el" href="classrapidjson_1_1_generic_reader.html">GenericReader</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classrapidjson_1_1_generic_reader-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">rapidjson::GenericReader&lt; Encoding, Allocator &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>SAX-style JSON parser. Use Reader for <a class="el" href="structrapidjson_1_1_u_t_f8.html" title="UTF-8 encoding.">UTF8</a> encoding and default allocator.  
 <a href="classrapidjson_1_1_generic_reader.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="reader_8h_source.html">reader.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a78b168d1221917d1c4545cd79275f2c1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a78b168d1221917d1c4545cd79275f2c1"></a>
typedef Encoding::Ch&#160;</td><td class="memItemRight" valign="bottom"><b>Ch</b></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aba3910976c0dc79134ee715d6075684b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrapidjson_1_1_generic_reader.html#aba3910976c0dc79134ee715d6075684b">GenericReader</a> (<a class="el" href="classrapidjson_1_1_allocator.html">Allocator</a> *allocator=0, size_t stackCapacity=kDefaultStackCapacity)</td></tr>
<tr class="memdesc:aba3910976c0dc79134ee715d6075684b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#aba3910976c0dc79134ee715d6075684b"></a><br/></td></tr>
<tr class="memitem:a62a1014258b1f716acc22782ee1cb269"><td class="memTemplParams" colspan="2">template&lt;unsigned parseFlags, typename Stream , typename Handler &gt; </td></tr>
<tr class="memitem:a62a1014258b1f716acc22782ee1cb269"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classrapidjson_1_1_generic_reader.html#a62a1014258b1f716acc22782ee1cb269">Parse</a> (<a class="el" href="classrapidjson_1_1_stream.html">Stream</a> &amp;stream, <a class="el" href="classrapidjson_1_1_handler.html">Handler</a> &amp;handler)</td></tr>
<tr class="memdesc:a62a1014258b1f716acc22782ee1cb269"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse JSON text.  <a href="#a62a1014258b1f716acc22782ee1cb269"></a><br/></td></tr>
<tr class="memitem:aa21dc3e432f6d178495e3d37e38cd6da"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa21dc3e432f6d178495e3d37e38cd6da"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>HasParseError</b> () const </td></tr>
<tr class="memitem:aa08f6cb381c9de7f580792016c245068"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa08f6cb381c9de7f580792016c245068"></a>
const char *&#160;</td><td class="memItemRight" valign="bottom"><b>GetParseError</b> () const </td></tr>
<tr class="memitem:a68d9cb6809b5f185b9c6f85c88683776"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a68d9cb6809b5f185b9c6f85c88683776"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>GetErrorOffset</b> () const </td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Encoding, typename Allocator = MemoryPoolAllocator&lt;&gt;&gt;<br/>
class rapidjson::GenericReader&lt; Encoding, Allocator &gt;</h3>

<p>SAX-style JSON parser. Use Reader for <a class="el" href="structrapidjson_1_1_u_t_f8.html" title="UTF-8 encoding.">UTF8</a> encoding and default allocator. </p>
<p><a class="el" href="classrapidjson_1_1_generic_reader.html" title="SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator.">GenericReader</a> parses JSON text from a stream, and send events synchronously to an object implementing <a class="el" href="classrapidjson_1_1_handler.html" title="Concept for receiving events from GenericReader upon parsing.">Handler</a> concept.</p>
<p>It needs to allocate a stack for storing a single decoded string during non-destructive parsing.</p>
<p>For in-situ parsing, the decoded string is directly written to the source text string, no temporary buffer is required.</p>
<p>A <a class="el" href="classrapidjson_1_1_generic_reader.html" title="SAX-style JSON parser. Use Reader for UTF8 encoding and default allocator.">GenericReader</a> object can be reused for parsing multiple JSON text.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname"><a class="el" href="classrapidjson_1_1_encoding.html" title="Concept for encoding of Unicode characters.">Encoding</a></td><td><a class="el" href="classrapidjson_1_1_encoding.html" title="Concept for encoding of Unicode characters.">Encoding</a> of both the stream and the parse output. </td></tr>
    <tr><td class="paramname"><a class="el" href="classrapidjson_1_1_allocator.html" title="Concept for allocating, resizing and freeing memory block.">Allocator</a></td><td><a class="el" href="classrapidjson_1_1_allocator.html" title="Concept for allocating, resizing and freeing memory block.">Allocator</a> type for stack. </td></tr>
  </table>
  </dd>
</dl>
</div><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aba3910976c0dc79134ee715d6075684b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Encoding, typename Allocator = MemoryPoolAllocator&lt;&gt;&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classrapidjson_1_1_generic_reader.html">rapidjson::GenericReader</a>&lt; <a class="el" href="classrapidjson_1_1_encoding.html">Encoding</a>, <a class="el" href="classrapidjson_1_1_allocator.html">Allocator</a> &gt;::<a class="el" href="classrapidjson_1_1_generic_reader.html">GenericReader</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classrapidjson_1_1_allocator.html">Allocator</a> *&#160;</td>
          <td class="paramname"><em>allocator</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>stackCapacity</em> = <code>kDefaultStackCapacity</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">allocator</td><td>Optional allocator for allocating stack memory. (Only use for non-destructive parsing) </td></tr>
    <tr><td class="paramname">stackCapacity</td><td>stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2>Member Function Documentation</h2>
<a class="anchor" id="a62a1014258b1f716acc22782ee1cb269"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Encoding, typename Allocator = MemoryPoolAllocator&lt;&gt;&gt; </div>
<div class="memtemplate">
template&lt;unsigned parseFlags, typename Stream , typename Handler &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classrapidjson_1_1_generic_reader.html">rapidjson::GenericReader</a>&lt; <a class="el" href="classrapidjson_1_1_encoding.html">Encoding</a>, <a class="el" href="classrapidjson_1_1_allocator.html">Allocator</a> &gt;::Parse </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classrapidjson_1_1_stream.html">Stream</a> &amp;&#160;</td>
          <td class="paramname"><em>stream</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classrapidjson_1_1_handler.html">Handler</a> &amp;&#160;</td>
          <td class="paramname"><em>handler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Parse JSON text. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">parseFlags</td><td>Combination of ParseFlag. </td></tr>
    <tr><td class="paramname"><a class="el" href="classrapidjson_1_1_stream.html" title="Concept for reading and writing characters.">Stream</a></td><td>Type of input stream. </td></tr>
    <tr><td class="paramname"><a class="el" href="classrapidjson_1_1_handler.html" title="Concept for receiving events from GenericReader upon parsing.">Handler</a></td><td>Type of handler which must implement <a class="el" href="classrapidjson_1_1_handler.html" title="Concept for receiving events from GenericReader upon parsing.">Handler</a> concept. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stream</td><td>Input stream to be parsed. </td></tr>
    <tr><td class="paramname">handler</td><td>The handler to receive events. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether the parsing is successful. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/rapidjson_version0.1x/include/rapidjson/<a class="el" href="reader_8h_source.html">reader.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Nov 16 2012 21:08:20 for rapidjson by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>
